<?php
/**
 * 描述
 * Created by Paco
 * Date: 2019/1/25 Time: 17:38
 */

namespace App\Http\Controllers\Admin\Product;


use App\Http\Controllers\Controller;
use App\Repositories\Product\ProductRepository;
use Illuminate\Http\Request;

class ProductController extends Controller
{
    private $product;

    public function __construct(ProductRepository $product)
    {
        $this->product = $product;
    }


    public function index(Request $request)
    {
        $params = $request->all();
        return $this->product->product($params);
    }

    public function show($product_id)
    {
        return $this->product->show($product_id);
    }


    public function checked(Request $request)
    {
        $pro_ids = $request->input('product_id');
        $checked = $request->input('checked',0);
        $reason =  $request->input('checked_reason','');
        return $this->product->checked($pro_ids,$checked,$reason);
    }
}